package com.heima;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * long类型时间转换
 */
public class DateTime {

    public static void main(String[] args) {
        long time = 0L;
        SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        java.util.Date date = new Date(time);
        String str = sdf.format(date);
        System.out.println(str);

    }

}
